home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AGA Toolkit '97
/
The AGA Toolkit '97.iso
/
c
/
fakemouse.doc
< prev
next >
Wrap
Text File
|
1996-09-07
|
3KB
|
56 lines
FakeMouse.doc
This is a fairly quick program with a limited audience (hence the simple
documentation). This is only the first release, there are a number of
parameters that are hard-coded into the program that I want to make
configurable from outside, but I thought I'd get some comments in first.
Parameters I'm intending to do this with are marked (X)
WHAT IT IS.
FakeMouse is a program written for OS V40 (CD32 - although it runs on kicked
A4000s). It also requires >=68020. Once run, it sits in the background and
monitors the controller plugged into port A (X). Depending on what you do,
it generates mouse events that allow the Intuition pointer to do all the
things it would do if a mouse was plugged in. Typically, the program would
be fired up at boot time and left running. It doesn't take up much space,
and shouldn't use much CPU time (although I haven't gone nutty shaving off
microseconds).
WHO IT'S FOR.
Any CD32 developers who are producing CD's that may require the use of a
mouse or use a mouse-type interface. Particularly those compiling PD or
compilation CD's written before the CD32/Joypad days. This program can
be freely used however you see fit.
HOW IT WORKS.
Every 25 mS (X), FakeMouse scans port A (X). It is looking for a Joystick or
a Joypad. A mouse isn't supported, because if you had one it would be in
port B, and you wouldn't need to fake anything! Any of Up/Down/Left/Right
generate faked events that cause the mouse pointer to move in the
appropriate direction at an accelerating rate decided by the program (X).
The Joypad Red button generates Left Mouse Button events, and the Blue
button generates Right Mouse Button events.
For joystick users, the situation is complicated slightly by only having one
button. What I have done here is generate Left Mouse button events for the
trigger, but if you hold the trigger down for >1 second (X), the Left button
is released, and a Right mouse button event is generated instead. Note that
for joystick users, you can't simulate both buttons held down simultaneously.
The program copes with swapping controller types.
Running the program for a second time removes the one running in the
background.
PROBLEMS.
FakeMouse seems to do its job reasonably well. It may look a little jerky.
I have set a poll time of 25mS, which looks OK, and keeps the processor
overhead down. Poll times of 10mS look very smooth, but obviously use more
CPU. When this is configurable from outside, you can pick values that look
good or suit your CPU budget.
COMMENTS.
Let me know of any changes or improvements you want.
INTERNET: sgoddy@cix.compulink.co.uk
CIS : 100014,674